package com.cn.redis.properties;


import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component("com.cn.redis.properties.sf")
@ConfigurationProperties(
        prefix = "idgenerator.sf",
        ignoreUnknownFields = false
)
public class SnowFlowerProperties {
    public static final String w = "et";
    public static final String x = "st";
    private String bit = "et";
    private long workerId = 1L;
    private long workerIdBits = 5L;
    private long sequenceBits = 10L;
    private final long y;
    private final long z;
    private final long A;
    private final long B;

    public SnowFlowerProperties() {
        this.y = ~(-1L << (int)this.workerIdBits);
        this.z = this.sequenceBits;
        this.A = this.sequenceBits + this.workerIdBits;
        this.B = ~(-1L << (int)this.sequenceBits);
    }

    public String x() {
        return this.bit;
    }

    public void c(String bit) {
        this.bit = bit;
    }

    public long y() {
        return this.workerId;
    }

    public void h(long workerId) {
        this.workerId = workerId;
    }

    public long z() {
        return this.workerIdBits;
    }

    public void i(long workerIdBits) {
        this.workerIdBits = workerIdBits;
    }

    public long A() {
        return this.sequenceBits;
    }

    public void j(long sequenceBits) {
        this.sequenceBits = sequenceBits;
    }

    public long B() {
        return this.y;
    }

    public long C() {
        return this.z;
    }

    public long D() {
        return this.A;
    }

    public long E() {
        return this.B;
    }
}
